package com.yeyks.common.em.order;

/**
 * 订单数据来源类型
 *
 * @author: dagny
 * @date: 2019/10/25 0025 14:43
 */
public enum OrderSourceTypeEnum {
    YYKS("yyks","自营"),
    CNBOOKING("cn","龙腾捷旅");

    String value;
    String desc;

    OrderSourceTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDesc(String value) {
        for (OrderSourceTypeEnum sourceTypeEnum : values()) {
            if (sourceTypeEnum.getValue().equals(value)) {
                return sourceTypeEnum.getDesc();
            }
        }
        return null;
    }

    public static String getValue(String desc) {
        for (OrderSourceTypeEnum sourceTypeEnum : values()) {
            if (sourceTypeEnum.getDesc().equals(desc)) {
                return sourceTypeEnum.getValue();
            }
        }
        return null;
    }


}
